package com.lianxueda.drawing.domain.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.lianxueda.drawing.common.CreateGroup;
import com.lianxueda.drawing.common.UpdateGroup;
import com.lianxueda.drawing.common.annotation.Status;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * 学生表单实体类
 * @author lds
 */
@Getter
@Setter
@NoArgsConstructor
public class WxLeaveFormDTO implements java.io.Serializable {
    private static final long serialVersionUID = 1L;

    @NotNull(message = "考生ID不能为空", groups = { UpdateGroup.class })
    private Integer id;

    @Positive(message = "学生ID必须大于0", groups = { CreateGroup.class })
    private Integer studentId;

    @NotBlank(message = "请假原因不能为空",groups = {UpdateGroup.class, CreateGroup.class })
    private String reason;

    @NotNull(message = "开始时间不能为空",groups = { UpdateGroup.class,CreateGroup.class })
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime startTime;

    @NotNull(message = "结束时间不能为空",groups = { UpdateGroup.class,CreateGroup.class })
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime endTime;

    @NotNull(message = "请假状态不能为空",groups = {UpdateGroup.class, CreateGroup.class })
    @Status(message = "请假状态无效", statusType = {"0", "1"})
    private Integer status;

}